<?php

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of BPMeta
 *
 * @author i062261
 */
class BAMeta extends BTreeItem {

    //put your code here

    public function getRepository($data = NULL, $reload = FALSE) {
        $repository = parent::getRepository($data, $reload);
        $repository->setModel($this->getModelClass());
        return $repository;
    }

    public function getModelClass($data = NULL) {
        return 'BAMMeta';
    }

    public function getRootNodeContext($context = NULL) {

        if ($this->spaceId == NULL) {
            $this->spaceId = Blyn::app()->getActiveSpace()->getId();
        }
        if ($this->appId == NULL) {
            $this->appId = Blyn::app()->getActiveApp()->getId();
        }
        $context = array(
            'spaceId' => $this->spaceId,
            'appId' => $this->appId);
        return parent::getRootNodeContext($context);
    }

}
